package com.tanhua.server.controller;

import com.tanhua.server.interceptor.UserHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/huanxin")
public class HuanXinController {

    @GetMapping("/user")
    public ResponseEntity<Object> user(){
        Map<String,String> params = new HashMap<>();
        params.put("username", UserHolder.getUserId().toString());
        params.put("password", "123456");
        return ResponseEntity.ok(params);
    }

}
